package com.zero;

import java.util.Scanner;

/**
 * Created by aicaikeji on 2018/12/26.
 */
public class scaner_demo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in); //键盘录入
        System.out.println("请输入...");
        if (sc.hasNext()) {
            int i = sc.nextInt(); //键盘录入整数存在i中
            System.out.println("您输入了：" + i);
        }
        if (sc.hasNextLine()) {
            String i = sc.nextLine(); //键盘录入整数存在i中
            System.out.println("您输入了：" + i);
        }
        sc.close();
    }



}
